package di

import (
	"fmt"
	userRepo "git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/base/user"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/bigdata"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/business_opportunity"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/clue"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/common"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/common/message"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/project"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/report"
	subscription2 "git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/subscription"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/supplier"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/tenant"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/user"
	"git.mycaigou.com/gfyx/micro-gfyx-mp-api/infrastructure/repository/user/mp"
)

func (c *Inject) InjectRepo() {
	repos := []interface{}{
		business_opportunity.NewContactRepository,
		business_opportunity.NewCustomerRepository,
		business_opportunity.NewProjectRepository,
		business_opportunity.NewBidRepository,
		business_opportunity.NewBuildingRepository,
		clue.NewClueRepository,
		common.NewCommonRepository,
		common.NewFileRepository,
		common.NewOptionRepository,
		common.NewMiniProgramRepository,
		message.NewVerifyCodeRepository,
		mp.NewMpRepository,
		project.NewSearchProjectRepository,
		report.NewReportFollowRepository,
		report.NewReportRepository,
		subscription2.NewSubscriptionRepository,
		supplier.NewSupplierRepository,
		user.NewUserRepository,
		userRepo.NewUserNewRepository,
		bigdata.NewBigdataRepository,
		tenant.NewTenantsRepository,
	}
	var errs []error
	for _, repo := range repos {
		err := c.Provide(repo)
		if err != nil {
			errs = append(errs, err)
		}
	}

	fmt.Printf("InjectRepo #%+v\n", errs)
}
